// 订阅类
class Notice {
	constructor() {
		this.subs = [];
	}
	sub(item) {
		const m= this.subs.filter(im => {
			im.key === item.key;
		});
		if(m.length === 0 && item.key) {
			this.subs.push(item);
		}
	}
	pub() {
		this.subs.forEach(sub => sub.update());
	}
}

module.exports = Notice;